<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>更改姓名</title>
<link rel="stylesheet" type="text/css" href="/style/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/xshop.css?ver=20170916" />
<script src="/style/js/jquery-1.12.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/xShop.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="outwrap">
	<!--top-->	

   <div class="meinner-adr-add box-top">
    <div class="iptform iptformm30">
    <form action="" method="post">
      <div class="item-ipt">
        <span class="name">姓名 </span><input type="text"  maxlength="20" value="<?=$this->users['name'];?>" placeholder="请输入姓名" class="txtpla" name="name" id="name"/>
      </div>
    </form>
    </div>
    <div class="btnwrap">
      <input type="button" class="btn-mexl btn-bc" id="sub_btn" value="保存" />
    </div>
  </div>
</div>
<script type="text/javascript" src="/style/js/sweet-alert.min.js"></script>
<link type="text/css" rel="stylesheet" href="/style/css/sweet-alert.css">
<script>
$(document).ready(function() {
    $("#sub_btn").click(function() {
        if ($("#name").val() == "") {
            swal("姓名不能为空");
            return false;
        }
       
        $.post("/user/ajax", {
            "act": "name",
            "name": $("#name").val(),
            "mr": Math.random()
        }, function(data) {
            if (data.code == 200) {
                swal(data.msg, false, "success");
                setTimeout(function() {
                    window.history.back(1);
                }, 2100);
            }else{ 
                swal(data.msg, false, "error");
            }
        }, 'json');
    });
});

</script>
</body>
</html>
